FROM maven:3.8.4-openjdk-8-slim AS build

WORKDIR /app

COPY pom.xml .

COPY src ./src

RUN mvn clean package -DskipTests

FROM openjdk:8

COPY --from=build /app/target/pets_java-0.0.1-SNAPSHOT.jar /app/server.jar

EXPOSE 28080

CMD [ "java","-jar","/app/server.jar" ]
